package com.atguigu.gulimall.ware.feign;

import com.atguigu.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient("gulimall-product")
public interface ProductFeignService {

    /**
     * 两种请求方式：
     *  FeignClient("gulimall-gateway") + /product/spuinfo/info/{id}      给gulimall-product微服务直接发送请求
     *  FeignClient("gulimall-gateway") + /api/product/spuinfo/info/{id}  给网关发送请求，由网关转发到具体微服务
     *
     * @param id
     * @return
     */
    @RequestMapping("/product/spuinfo/info/{id}")
    public R info(@PathVariable("id") Long id);
}
